#include<iostream>
#include"UdpServer.hpp"
#include"Dict.hpp"
void Usage(char* arg)
{
    std::cout<<"Usage:  please enter:"<<std::endl;
    std::cout<<arg<<' '<<"server port"<<std::endl;
}

int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    Enablescreen();
    uint16_t port=std::stoi(argv[1]);
    Dict_serve dict;
    UdpServer udps(port,std::bind(&Dict_serve::translate,&dict,std::placeholders::_1));
    udps.InitServer();
    udps.start();


    return 0;
}